import React, { Component } from 'react';
import { Form, Select, Input, Button, Modal } from 'antd';
const FormItem = Form.Item;
const Option = Select.Option;
const { TextArea } = Input;

class PopForm1 extends Component {

  render() {
    const { visible, onCancel, onCreate, form } = this.props;
    const { getFieldDecorator } = form;
    return (
      <Modal
        visible={visible}
        title="创建"
        okText="确定"
        cancelText="取消"
        onCancel={onCancel}
        onOk={onCreate}
      >
        <Form>
          <FormItem
            label="编码"
            labelCol={{ span: 5 }}
            wrapperCol={{ span: 16 }}
          >
            {getFieldDecorator('code', {
              rules: [{ required: true, message: '请输入编码!', }],
            })(
              <Input placeholder="请输入编码" />
            )}
          </FormItem>
          <FormItem
            label="类型名称"
            labelCol={{ span: 5 }}
            wrapperCol={{ span: 16 }}
          >
            {getFieldDecorator('name', {
              rules: [{ required: true, message: '请输入类型名称!', }],
            })(
              <Input placeholder="请输入类型名称" />
            )}
          </FormItem>
          <FormItem
            label="描述"
            labelCol={{ span: 5 }}
            wrapperCol={{ span: 16 }}
          >
            {getFieldDecorator('description', {
              rules: [{ required: true, message: '请输入描述!', }],
            })(
              <Input placeholder="请输入描述" />
            )}
          </FormItem>
        </Form>
      </Modal>
    );
  }

}
const AddForm = Form.create()(PopForm1);
export default AddForm;